#ifndef __FPS_COMMONGL_MATERIAL_RENDERER_H__
#define __FPS_COMMONGL_MATERIAL_RENDERER_H__

#include "IrrCompileGameConfig.h"
#if defined(_IRR_COMPILE_WITH_OPENGL_) || defined(_IRR_COMPILE_WITH_OPENGL_ES_) || defined(_IRR_COMPILE_WITH_PS3_)

#include "CCommonGLMaterialRenderer.h"

//! Same as EMT_TRANSPARENT_ADD_COLOR but the material is marked as non transparent
#define EMT_NONTRANSPARENT_ALPHA_TEST					((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 0))

//! Same as EMT_TRANSPARENT_ADD_COLOR but the material is marked as non transparent
#define EMT_NONTRANSPARENT_ADDITIVE_REPLACE				((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 1))

//! Same as EMT_TRANSPARENT_ADD_COLOR but the material is marked as non transparent
#define EMT_NONTRANSPARENT_ADDITIVE_MODULATE			((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 2))

//! Same as EMT_TRANSPARENT_ADD_COLOR but the material is marked as non transparent
#define EMT_TRANSPARENT_ALPHA_CHANNEL_WITH_VERTEX_ALPHA	((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 3))

//! Same as EMT_TRANSPARENT_ALPHA_CHANNEL_REF, but with alpha blending
#define EMT_TRANSPARENT_ALPHA_CHANNEL_REF_BLEND			((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 4))

//! Ambient color material with alpha from texture
#define EMT_AMBIENT_COLOR_TEXTURE_ALPHA					((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 5))

//! Same as EMT_TRANSPARENT_ALPHA_CHANNEL, but ambient color is used as additive
#define EMT_TRANSPARENT_ADD_AMBIENT_COLOR				((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 6))

//! Ambient color material. No texture is used
#define EMT_AMBIENT_COLOR								((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 7))

//! Ambient color material. No texture is used
#define EMT_AMBIENT_COLOR_DST_ALPHA						((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 8))

//! Same as EMT_TRANSPARENT_ALPHA_CHANNEL, but ambient color is used to subtract
#define EMT_TRANSPARENT_SUB_AMBIENT_COLOR				((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 9))

//! Same as EMT_TRANSPARENT_ALPHA_CHANNEL, but ambient color is used to add, alpha set
#define EMT_TRANSPARENT_ADD_COLOR_SUB_ALPHA				((irr::video::E_MATERIAL_TYPE)(irr::video::EMT_COUNT + 10))

//! Non Transparent alpha test material renderer - replace
class CCommonGLMaterialRenderer_ALPHA_TEST_NONTRANSPARENT : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_ALPHA_TEST_NONTRANSPARENT(irr::video::CCommonGLDriver* d)
		: irr::video::CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};

//! Non Transparent add color material renderer - replace
class CCommonGLMaterialRenderer_ADDITIVE_REPLACE_NONTRANSPARENT : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_ADDITIVE_REPLACE_NONTRANSPARENT(irr::video::CCommonGLDriver* d)
		: irr::video::CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};

	
//! Non Transparent add color material renderer - Modulate
class CCommonGLMaterialRenderer_ADDITIVE_MODULATE_NONTRANSPARENT : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_ADDITIVE_MODULATE_NONTRANSPARENT(irr::video::CCommonGLDriver* d)
		: irr::video::CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};


//! Transparent alpha channel material renderer
class CCommonGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_WITH_VERTEX_ALPHA : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_WITH_VERTEX_ALPHA (irr::video::CCommonGLDriver* d)
		: irr::video::CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;

};


//! Transparent alpha channel material renderer
class CCommonGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF_BLEND : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF_BLEND(irr::video::CCommonGLDriver* d)
		: CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};


class CCommonGLMaterialRenderer_AMBIENT_COLOR_TEXTURE_ALPHA : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_AMBIENT_COLOR_TEXTURE_ALPHA(irr::video::CCommonGLDriver* d)
		: CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};


class CCommonGLMaterialRenderer_TRANSPARENT_ADD_AMBIENT_COLOR : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_TRANSPARENT_ADD_AMBIENT_COLOR(irr::video::CCommonGLDriver* d)
		: CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};


class CCommonGLMaterialRenderer_TRANSPARENT_SUB_AMBIENT_COLOR : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_TRANSPARENT_SUB_AMBIENT_COLOR(irr::video::CCommonGLDriver* d)
		: CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};


class CCommonGLMaterialRenderer_AMBIENT_COLOR : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_AMBIENT_COLOR(irr::video::CCommonGLDriver* d)
		: CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};


class CCommonGLMaterialRenderer_AMBIENT_COLOR_DST_ALPHA : public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_AMBIENT_COLOR_DST_ALPHA(irr::video::CCommonGLDriver* d)
		: CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};


class CCommonGLMaterialRenderer_TRANSPARENT_ADD_COLOR_SUB_ALPHA: public irr::video::CCommonGLMaterialRenderer
{
public:

	CCommonGLMaterialRenderer_TRANSPARENT_ADD_COLOR_SUB_ALPHA(irr::video::CCommonGLDriver* d)
		: CCommonGLMaterialRenderer(d) {}

	virtual void onSetMaterial(const irr::video::SMaterial& material,
							   const irr::video::SMaterial& lastMaterial,
							   bool resetAllRenderstates,
							   irr::video::IMaterialRendererServices* services);

	virtual void onUnsetMaterial();

	//! Returns if the material is transparent.
	virtual bool isTransparent() const;

	virtual irr::u32 getVertexAttributeMask() const;
};


#endif // _IRR_COMPILE_WITH_OPENGL_ || _IRR_COMPILE_WITH_OPENGL_ES_

#endif //__FPS_COMMONGL_MATERIAL_RENDERER_H__